//
//  LaunchViewController.m
//  ZGSHGYS
//
//  Created by hnb on 2016/11/21.
//  Copyright © 2016年 yncc. All rights reserved.
//

#import "LaunchViewController.h"
#import "ViewController.h"


@interface LaunchViewController ()
@property (nonatomic,strong) UIImageView *imageView;
@end

@implementation LaunchViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    if (IsiPhone4) {
        [self.imageView sd_setImageWithURL:[NSURL URLWithString:@""] placeholderImage:[UIImage imageNamed:@"640-960"]];
    }else if (IsiPhone5){
        [self.imageView sd_setImageWithURL:[NSURL URLWithString:@""] placeholderImage:[UIImage imageNamed:@"640-1136"]];

    }else if (IsiPhone6){
        [self.imageView sd_setImageWithURL:[NSURL URLWithString:@""] placeholderImage:[UIImage imageNamed:@"750-1334"]];

    }else if (IsiPhone6P){
        [self.imageView sd_setImageWithURL:[NSURL URLWithString:@""] placeholderImage:[UIImage imageNamed:@"1242-2208"]];

    }
    [self performSelector:@selector(changeView) withObject:self afterDelay:2];
}
-(UIImageView *)imageView{
    if (!_imageView) {
        _imageView = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0, ScreenWidth, ScreenHeight)];
        _imageView.contentMode = UIViewContentModeScaleAspectFit;
        [self.view addSubview:_imageView];
    }
    return _imageView;
}
//切换到下一个界面
- (void)changeView {
    UIWindow *window = self.view.window;
    ViewController *main = [[ViewController alloc] init];
    //添加一个缩放效果
    main.view.transform = CGAffineTransformMakeScale(0.2, 0.2);
    [UIView animateWithDuration:0.1 animations:^{
        main.view.transform = CGAffineTransformIdentity;
    }];
    window.rootViewController = main;
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
